*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Toggle switch */

.toggle-label {
  @apply relative block w-10 h-5 cursor-pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(0, 0, 0);
}

.toggle-label:before {
  content: "";
  @apply relative block bg-gray-500;
  position: relative;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 14px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.toggle-label span {
  @apply absolute w-5 h-5 top-0 start-0 block bg-white shadow-md rounded-full;
  transition: all 0.2s ease;
}

.toggle-label span:before {
  content: "";
  @apply absolute block w-14 h-14 bg-primary-400 pointer-events-none opacity-100 rounded-full;
  margin: -18px;
  transform: scale(0);
}

.toggle-input:checked + .toggle-label:before {
  @apply bg-primary-400;
}

.toggle-input:checked + .toggle-label span {
  @apply bg-primary-500;
  transform: translateX(20px);
  transition:
    all 0.2s cubic-bezier(0.8, 0.4, 0.3, 1.25),
    background 0.15s ease;
  box-shadow: 0 3px 8px rgba(79, 46, 220, 0.2);
}

.toggle-input:checked + .toggle-label span:before {
  transform: scale(1);
  opacity: 0;
  transition: all 0.4s ease;
}

.blanket {
  bottom: 0px;
  left: 0px;
  position: fixed;
  right: 0px;
  top: 0px;
  z-index: 500;
  animation-name: blanket-animation 0.4s cubic-bezier(0.63, 0.34, 0, 1) normal;
}

@keyframes blanket-animation {
  from {
    background: rgba(9, 30, 66, 0);
  }
  to {
    background: rgba(9, 30, 66, 0.54);
  }
}

@keyframes slideIn {
  0% {
    right: -9999px;
  }
}

@keyframes slideIn--rtl {
  0% {
    left: -9999px;
  }
}

[dir="rtl"] .drawer-right {
  left: 0px;
  right: auto;
  animation: slideIn--rtl 0.3s cubic-bezier(0.63, 0.34, 0, 1) normal;
}

.drawer-right {
  @apply bg-white;
  display: flex;
  height: 100vh;
  right: 0px;
  position: fixed;
  top: 0px;
  width: 100%;
  z-index: 501;
  animation: slideIn 0.3s cubic-bezier(0.63, 0.34, 0, 1) normal;
}

/* Community */

.community-ask-button-container:before {
  @apply absolute;
  content: "";
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: rgb(255, 255, 255);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(191, 184, 204, 1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  width: 100%;
}

@screen md {
  .drawer-right {
    @apply w-4/5;
  }
}

@screen xl {
  .drawer-right {
    width: 48rem;
  }
  .drawer-right-large {
    width: 64rem;
  }
}

[dir="rtl"] .drawer-right__close {
  right: -52px;
  z-index: -1;
}

.drawer-right__close {
  left: -52px;
  z-index: -1;
}

.drawer-right-form {
  overflow-x: hidden;
  overflow-y: scroll;
  @apply text-sm bg-white;
}

.drawer-right-form__error-msg {
  @apply mt-1 px-1 py-px rounded text-xs font-medium text-red-600 bg-red-100 inline-flex items-center;
}

.sa-toggle__menu-btn {
  @apply p-4 inline-block cursor-pointer;
  transition-property: opacity, filter;
  transition-duration: 0.15s;
  transition-timing-function: linear;
  overflow: visible;
}

.sa-toggle__menu-btn:hover {
  opacity: 0.7;
}

.sa-toggle__menu-btn.is-active:hover {
  opacity: 0.7;
}

.sa-toggle__menu-btn.is-active .sa-toggle__menu-btn-inner,
.sa-toggle__menu-btn.is-active .sa-toggle__menu-btn-inner::before,
.sa-toggle__menu-btn.is-active .sa-toggle__menu-btn-inner::after {
  @apply bg-gray-800;
}

.sa-toggle__menu-btn-box {
  width: 20px;
  height: 14px;
  @apply relative inline-block;
}

.sa-toggle__menu-btn-inner {
  display: block;
  top: 50%;
}

.sa-toggle__menu-btn-inner,
.sa-toggle__menu-btn-inner::before,
.sa-toggle__menu-btn-inner::after {
  @apply bg-black;
  width: 20px;
  height: 2px;
  border-radius: 4px;
  position: absolute;
  transition-property: transform;
  transition-duration: 0.15s;
  transition-timing-function: ease;
}

.sa-toggle__menu-btn-inner::before,
.sa-toggle__menu-btn-inner::after {
  content: "";
  display: block;
}

.sa-toggle__menu-btn-inner::before {
  top: -6px;
}

.sa-toggle__menu-btn-inner::after {
  bottom: -6px;
}

.sa-toggle__menu-btn--arrow.is-active .sa-toggle__menu-btn-inner::before {
  transform: translate3d(-6px, 3px, 0) rotate(-45deg) scale(0.5, 1);
}

.sa-toggle__menu-btn--arrow.is-active .sa-toggle__menu-btn-inner::after {
  transform: translate3d(-6px, -3px, 0) rotate(45deg) scale(0.5, 1);
}

.file-input-label {
  @apply truncate py-2 cursor-pointer flex px-4 items-center font-medium rounded text-sm border border-dashed border-primary-200 bg-primary-50;
}

.file-input-label:hover,
.file-input-label:focus {
  @apply bg-primary-100;
}

.toggle-button__group {
  @apply relative leading-relaxed rounded bg-white;
}

.toggle-button__button {
  @apply w-1/2 text-sm font-medium py-1 px-6 text-gray-600 border border-gray-300 focus:ring-1 focus:ring-inset focus:ring-focusColor-500;
  transition: 0.3s cubic-bezier(0, 0, 0, 1);
}

.toggle-button__button:first-child {
  @apply rounded-s;
}

.toggle-button__button:last-child {
  @apply rounded-e;
}

.toggle-button__button:not(:last-of-type) {
  @apply border-e-transparent;
}

.toggle-button__button:hover {
  @apply bg-gray-50 text-gray-900;
}

.toggle-button__button:focus {
  @apply outline-none text-gray-900;
}

.toggle-button__button--active {
  @apply bg-primary-50 text-primary-500 border-primary-500;
}

.toggle-button__button--active:not(:last-of-type) {
  border-inline-end-color: currentColor;
}

.target-group__container > :not(:last-child):before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  z-index: -1;
  @apply bg-primary-400;
}

.target-group__box {
  z-index: 10;
}

.target-group__target-container {
  transition: all 0.2s;
}

.target-group__target {
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
}

.target-group__header {
  min-height: 7rem;
}

.target-group__header--archived,
.target-group__target--archived {
  background-color: theme("colors.yellow.100");
  background-image: linear-gradient(
    to bottom right,
    rgba(0, 0, 0, 0.05) 25%,
    transparent 0,
    transparent 50%,
    rgba(0, 0, 0, 0.05) 0,
    rgba(0, 0, 0, 0.05) 75%,
    transparent 0,
    transparent
  );
  background-repeat: repeat;
  background-size: 10px 10px;
  box-shadow: inset 0 2px 10px -6px rgba(0, 0, 0, 0.5);
}

.target-group__group-reorder {
  max-height: 4.5rem;
  top: 50%;
  @apply ltr:-start-9	rtl:-end-9;
  z-index: -1;
  transform: translateY(-50%);
}

.target-group__group-reorder-up {
  transform: translateY(15px);
  transition: transform 0.2s;
}

.target-group__group-reorder-down {
  transform: translateY(-15px);
  transition: transform 0.2s;
}

.target-group__target-reorder-up {
  transform: translateY(15px);
  transition: transform 0.2s;
}

.target-group__target-reorder-down {
  transform: translateY(-15px);
  transition: transform 0.2s;
}

.target-group__header-container:hover .target-group__group-reorder:before {
  position: absolute;
  content: "";
  @apply bg-gray-300;
  height: 1px;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
}

.target-group__header-container:hover .target-group__group-reorder {
  @apply bg-gray-50;
}

.target-group__header-container:hover .target-group__group-reorder-up {
  transform: translateY(0px);
  @apply text-gray-600;
}

.target-group__header-container:hover .target-group__group-reorder-down {
  transform: translateY(0px);
  @apply text-gray-600;
}

.target-group__target-container:hover .target-group__target-reorder {
  @apply bg-gray-50 border-e border-gray-300;
}

.target-group__target-container:hover .target-group__target-reorder:before {
  position: absolute;
  content: "";
  @apply bg-gray-300;
  height: 1px;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
}

.target-group__target-container:hover .target-group__target-reorder-up {
  transform: translateY(0px);
  @apply text-gray-600;
}

.target-group__target-container:hover .target-group__target-reorder-down {
  transform: translateY(0px);
  @apply text-gray-600;
}

.target-group__target-container:hover .target-group__target-reorder-up:hover,
.target-group__target-container:hover .target-group__target-reorder-down:hover {
  @apply text-gray-900;
}

/* .target-group__target-container:hover .target-group__target-draft-pill {
  visibility: hidden;
} */

.target-group__create,
.target-group__target-create {
  transition: all 0.2s;
}

.quiz-maker__question-container:hover .quiz-maker__question-remove-button {
  visibility: visible;
}

.quiz-maker__answer-option-correct {
  @apply bg-green-400 rounded-lg border border-green-500 shadow-md;
}

.quiz-maker__answer-option-correct .quiz-maker__answer-option-answer {
  @apply border-transparent;
}

.quiz-maker__answers-container::before {
  content: "";
  @apply absolute bg-gray-400;
  top: 45%;
  transform: translateY(-50%);
  height: calc(100% - 45px);
  margin-top: 0.875rem;
  bottom: 0;
  width: 1px;
  left: 1.5rem;
}

[dir="rtl"] .quiz-maker__answers-container::before {
  left: auto;
  right: 1.5rem;
}

.quiz-maker__answer-option-pointer {
  width: 1.375rem;
  height: 1.375rem;
  @apply absolute rounded-full overflow-hidden text-center text-white bg-white border border-gray-300;
  box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  transition: 0.3s cubic-bezier(0, 0, 0, 1);
}

[dir="rtl"] .quiz-maker__answer-option-pointer {
  left: 0px;
  right: 13px;
}

.quiz-maker__answer-option-pointer--correct {
  background: #10ab4c;
  @apply border border-white;
}

.quiz-maker__answer-option-pointer:hover {
  box-shadow:
    0 3px 3px 1px rgba(0, 0, 0, 0.1),
    inset 0 0 0 4px #39b54a;
}

.quiz-maker__add-answer-option-pointer {
  width: 1.75rem;
  height: 1.75rem;
  @apply bg-white absolute rounded-full;
  left: 10px;
  top: 50%;
  box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
}

[dir="rtl"] .quiz-maker__add-answer-option-pointer {
  left: auto;
  right: 10px;
}

.quiz-maker__add-answer-option:hover .quiz-maker__add-answer-option-pointer,
.quiz-maker__add-answer-option:focus .quiz-maker__add-answer-option-pointer {
  box-shadow: 0 3px 3px 1px rgba(0, 0, 0, 0.1);
  @apply text-primary-500 border-primary-500;
}

.quiz-maker__add-answer-option:hover .quiz-maker__add-answer-option-button,
.quiz-maker__add-answer-option:focus .quiz-maker__add-answer-option-button {
  @apply bg-white text-primary-500 shadow-md;
}

.select-list__item-selected {
  animation: glowing 500ms ease-in;
  @apply border-primary-400;
}

.select-list__item-selected-unremovable {
  @apply border-gray-300 bg-gray-50;
}

.form-input__range[type="range"] {
  @apply appearance-none w-full mt-2;
}

.form-input__range[type="range"]:focus {
  outline: none;
}

.form-input__range[type="range"]::-webkit-slider-runnable-track {
  @apply w-full h-2 cursor-pointer border border-gray-300 rounded-lg bg-gray-300;
}

.form-input__range[type="range"]::-webkit-slider-thumb {
  @apply h-4 w-4 shadow-md rounded-full bg-primary-500 cursor-pointer -mt-1 appearance-none;
}

.form-input__range[type="range"]:focus::-webkit-slider-runnable-track {
  @apply bg-gray-400;
}

.form-input__range[type="range"]::-moz-range-track {
  @apply w-full h-2 cursor-pointer border border-gray-300 rounded-lg bg-gray-300;
}

.form-input__range[type="range"]::-moz-range-thumb {
  @apply h-4 w-4 shadow-md border-2 border-white rounded-full bg-primary-500 cursor-pointer -mt-1 appearance-none;
}

select.select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

[dir="rtl"] select.select {
  background-position: left 0.5rem center;
  padding-right: 0.5rem;
  padding-left: 2.5rem;
}

@keyframes glowing {
  0% {
    box-shadow: 0 0 20px #7886d7;
  }
  50% {
    box-shadow: 0 0 10px #7886d7;
  }
  100% {
    box-shadow: 0 0 0 #7886d7;
  }
}

.element--highlighted {
  animation: elementGlowing 3s 1;
  -webkit-animation: elementGlowing 3s 1;
  -moz-animation: elementGlowing 3s 1;
}

@keyframes elementGlowing {
  0% {
    background-color: rgba(255, 250, 240, 1);
    box-shadow: 0 0 10px #fbd38d;
  }
  50% {
    background-color: rgba(255, 250, 240, 0.5);
    box-shadow: 0 0 5px #fbd38d;
  }
  100% {
    background-color: rgba(255, 250, 240, 0);
    box-shadow: 0 0 0 #fbd38d;
  }
}

@-webkit-keyframes elementGlowing {
  0% {
    background-color: rgba(255, 250, 240, 1);
    box-shadow: 0 0 10px #fbd38d;
  }
  50% {
    background-color: rgba(255, 250, 240, 0.5);
    box-shadow: 0 0 5px #fbd38d;
  }
  100% {
    background-color: rgba(255, 250, 240, 0);
    box-shadow: 0 0 0 #fbd38d;
  }
}

@-moz-keyframes elementGlowing {
  0% {
    background-color: rgba(255, 250, 240, 0.1);
    box-shadow: 0 0 10px #fbd38d;
  }
  50% {
    background-color: rgba(255, 250, 240, 0.5);
    box-shadow: 0 0 5px #fbd38d;
  }
  100% {
    background-color: rgba(255, 250, 240, 0);
    box-shadow: 0 0 0 #fbd38d;
  }
}
